//
//  BTViewController.m
//  UIHomeWork_07
//
//  Created by tusm on 16/7/23.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "BTViewController.h"
#import "JHButton.h"

@interface BTViewController ()

@end

@implementation BTViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.tabBarController.tabBar.hidden = NO;
    [self createSubView];
    self.view.backgroundColor = [UIColor colorWithRed:0.445 green:1.000 blue:0.908 alpha:1.000];
}
- (void)createSubView{
    
    JHButton *button = [JHButton buttonWithType:UIButtonTypeCustom frame:CGRectMake(self.view.center.x - 150  ,self.view.center.y - 150, 300, 300) title:nil  image:[UIImage imageNamed:@"半糖_1"] handler:^(UIButton *sender) {
        
    }];
    [self.view addSubview:button];
    
    [button addTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
    
    
}

- (void)handleButton:(UIButton *)button{
    self.tabBarController.tabBar.hidden = YES;
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
